


///////////////////////////////////////////////////////////////////////////////////////////////////
//////// Figure 3 - Distribution of Absolute Differences in CFscores Between Parties //////////////
///////////////////////////////////////////////////////////////////////////////////////////////////

*************** Panel A - Petitioners and Respondents *********************************************

** Load Master Data
use Data_OPO_Master.dta, clear

** Drop Observations with Missing Ideology Data
keep if use ==1

** View Quartlies
summarize dist_pet_resp if dist_pet_resp_quart==1, detail 
summarize dist_pet_resp if dist_pet_resp_quart==2, detail 
summarize dist_pet_resp if dist_pet_resp_quart==3, detail 
summarize dist_pet_resp if dist_pet_resp_quart==4, detail 

** Collapse Sample 
egen sample1 = cut(dist_pet_resp), at(0(.1)3.5)
generate temp = 1
collapse (sum) temp, by(sample1)
egen total = total(temp)
replace temp = temp/total

** Generate Graph

twoway (bar temp sample1 if sample1<0.3 , barwidth(.1) color(blue%40)) (bar temp sample1 if sample1 >=0.3 & sample1<1.9, barwidth(.1) color(gray%20)) (bar temp sample1 if sample1 >=1.9, barwidth(.1) color(red%80)), graphregion(color(white)) bgcolor(white) xtitle("Absolute Difference in CFscore") ytitle("Share of Observations") xlabel(0(.5)3.5) ylabel(0(.025)0.125) legend(order(1 3) label(1 "Ideological Aligned"))  legend(label(3 "Ideologically Opposed")) legend(region(lwidth(none)) pos(6) row(1)) yscale(noextend) xscale(noextend) xlabel(,nogextend) ylabel(,nogextend) graphregion(lwidth(none))


*************** Panel B - Petitioners and Panels *********************************************

** Load Master Data
use Data_OPO_Master.dta, clear


** Drop Observations with Missing Ideology Data
keep if use ==1

** View Quartlies
summarize dist_pet_coa if dist_pet_coa_quart==1, detail 
summarize dist_pet_coa if dist_pet_coa_quart==2, detail 
summarize dist_pet_coa if dist_pet_coa_quart==3, detail 
summarize dist_pet_coa if dist_pet_coa_quart==4, detail 

** Collapse Sample 
egen sample1 = cut(dist_pet_coa), at(0(.1)3.5)
generate temp = 1
collapse (sum) temp, by(sample1)
egen total = total(temp)
replace temp = temp/total

** Generate Graph
twoway (bar temp sample1 if sample1<0.5 , barwidth(.1) color(blue%40)) (bar temp sample1 if sample1 >=0.5 & sample1<1.6, barwidth(.1) color(gray%20)) (bar temp sample1 if sample1 >=1.6, barwidth(.1) color(red%80)), graphregion(color(white)) bgcolor(white) xtitle("Absolute Difference in CFscore") ///
		ytitle("Share of Observations") ///
		xlabel(0(.5)3.5) ylabel(0(.025)0.125) legend(order(1 3) pos(6) row(1) label(1 "Ideological Aligned"))  legend(label(3 "Ideologically Opposed")) legend(region(lwidth(none))) yscale(noextend) xscale(noextend) 



*************** Panel C - Respondents and Panels *********************************************

** Load Master Data
use Data_OPO_Master.dta, clear


** Drop Observations with Missing Ideology Data
keep if use ==1

** View Quartlies
summarize dist_resp_coa if dist_resp_coa_quart==1, detail 
summarize dist_resp_coa if dist_resp_coa_quart==2, detail 
summarize dist_resp_coa if dist_resp_coa_quart==3, detail 
summarize dist_resp_coa if dist_resp_coa_quart==4, detail 

** Collapse Sample 
egen sample1 = cut(dist_resp_coa), at(0(.1)3.5)
generate temp = 1
collapse (sum) temp, by(sample1)
egen total = total(temp)
replace temp = temp/total

** Generate Graph

twoway (bar temp sample1 if sample1<0.4 , barwidth(.1) color(blue%40)) (bar temp sample1 if sample1 >=0.4 & sample1<1.6, barwidth(.1) color(gray%20)) (bar temp sample1 if sample1 >=1.6, barwidth(.1) color(red%80)), graphregion(color(white)) bgcolor(white) xtitle("Absolute Difference in CFscore") ///
		ytitle("Share of Observations") ///
		xlabel(0(.5)3.5) ylabel(0(.025)0.125) legend(order(1 3) pos(6) row(1) label(1 "Ideological Aligned"))  legend(label(3 "Ideologically Opposed")) legend(region(lwidth(none))) yscale(noextend) xscale(noextend) 

